//
//  PiaoView.m
//  LoverGo
//
//  Created by liudonghuan on 14-9-15.
//  Copyright (c) 2014年 yexiao. All rights reserved.
//

#import "PiaoView.h"

@implementation PiaoView
@synthesize piaoDelegate  = _piaoDelegate;
- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        _bg = [[UIImageView alloc]initWithFrame:CGRectMake(0, SCREEN_HEIGHT/2-62-TOPBAR, SCREEN_WIDTH, 124)];
        _bg.image = [UIImage imageNamed:@"dianzijuanBG.png"];
        [self addSubview:_bg];
        
        _title = [[UILabel alloc]initWithFrame:CGRectMake(20, 0, 200, 60)];
        _title.font = [UIFont fontWithName:@"Helvetica" size:16];
        _title.text = @"";
        
        _dingdanhao = [[UILabel alloc]initWithFrame:CGRectMake(217, 14, 100, 20)];
        _dingdanhao.font = [UIFont fontWithName:@"Helvetica" size:13];
        _dingdanhao.text = @"";
        
        _taocanming = [[UILabel alloc]initWithFrame:CGRectMake(63, 68, 100, 20)];
        _taocanming.font = [UIFont fontWithName:@"Helvetica" size:13];
        _taocanming.text = @"";
        
        _shuliang= [[UILabel alloc]initWithFrame:CGRectMake(203, 68, 30, 20)];
        _shuliang.font = [UIFont fontWithName:@"Helvetica" size:13];
        _shuliang.text = @"";
        
        _jiage= [[UILabel alloc]initWithFrame:CGRectMake(268, 68, 40, 20)];
        _jiage.font = [UIFont fontWithName:@"Helvetica" size:13];
        _jiage.text = @"";
        
        _xiadanshijian= [[UILabel alloc]initWithFrame:CGRectMake(70, 90, 100, 20)];
        _xiadanshijian.font = [UIFont fontWithName:@"Helvetica" size:13];
        _xiadanshijian.text = @"";
        
        _shiyongqixian= [[UILabel alloc]initWithFrame:CGRectMake(230, 90, 100, 20)];
        _shiyongqixian.font = [UIFont fontWithName:@"Helvetica" size:13];
        _shiyongqixian.text = @"无";
        
        _fanhui = [[UIButton alloc]initWithFrame:CGRectMake(SCREEN_WIDTH/2-30, SCREEN_HEIGHT/2+30, 60, 40)];
        [_fanhui addTarget:self action:@selector(guanbi) forControlEvents:UIControlEventTouchUpInside];
        [_fanhui setTitle:@"关闭" forState:UIControlStateNormal];
        _fanhui.backgroundColor = LGCOLOR_graymore;
        
        _shanchu = [[UIButton alloc]initWithFrame:CGRectMake(SCREEN_WIDTH/2-100, SCREEN_HEIGHT/2+100, 200, 40)];
        [_shanchu addTarget:self action:@selector(woyaoshanchu) forControlEvents:UIControlEventTouchUpInside];
        [_shanchu setTitle:@"该订单已使用，我要删除" forState:UIControlStateNormal];
        _shanchu.backgroundColor = LGCOLOR_graymore;
        [_bg addSubview:_title];
        [_bg addSubview:_dingdanhao];
        [_bg addSubview:_taocanming];
        [_bg addSubview:_shuliang];
        [_bg addSubview:_jiage];
        [_bg addSubview:_xiadanshijian];
        [_bg addSubview:_shiyongqixian];
        
        [self addSubview:_bg];
        [self addSubview:_fanhui];
        //[self addSubview:_shanchu];
        
        
    }
    return self;
}
-(void)guanbi
{
    [_piaoDelegate guanbipiao];
}
-(void)woyaoshanchu
{
    [_piaoDelegate shanchupiao];
}


@end
